# Copyright (C) 1993-2015 Free Software Foundation, Inc.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  

# Please email any bugs, comments, and/or additions to this file to:
# dejagnu@gnu.org

# Written by the Center for Software Science at the Univeristy of Utah
# and by Cygnus Support.

proc do_imem {} {
    set testname "imem.s: integer memory loads and stores"
    set x 0

    gas_start "imem.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 489A0000\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0000 0C80109A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 449A0000\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 0C80105A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 409A0000\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 0C80101A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 689A0000\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 0C9A1280\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 649A0000\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 0C9A1240\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 609A0000\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 0C9A1200\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 4C9A0000\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 6C9A0000\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 0C85009A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 0C85209A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 0C8500BA\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 0C8520BA\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 0C85005A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 0C85205A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 0C85007A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 0C85207A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 0C85001A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 0C85201A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 0C85003A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 0C85203A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 0C85019A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 0C85219A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 0C8501BA\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 0C8521BA\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 0C8501DA\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 0C8521DA\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 0C8501FA\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 0C8521FA\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 0C80109A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 0C8030BA\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 0C8010BA\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c 0C80105A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 0C80307A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 0C80107A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 0C80101A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c 0C80303A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 0C80103A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 0C80119A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 0C8031BA\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c 0C8011BA\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a0 0C8011DA\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a4 0C8031FA\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a8 0C8011FA\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ac 0C9A1280\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b0 0C9A32A0\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b4 0C9A12A0\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b8 0C9A1240\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00bc 0C9A3260\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c0 0C9A1260\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c4 0C9A1200\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c8 0C9A3220\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00cc 0C9A1220\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d0 0C9A1380\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d4 0C9A33A0\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d8 0C9A13A0\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00dc 0C9A1300\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e0 0C9A1300\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e4 0C9A3300\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e8 0C9A1320\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ec 0C9A3320\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==60] then { pass $testname } else { fail $testname }
}

proc do_immed {} {
    set testname "immed.s: immediate tests"
    set x 0

    gas_start "immed.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 375A000A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 234DFBD5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 28ADFBD5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it 
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==3] then { pass $testname } else { fail $testname }
}

proc do_branch {} {
    set testname "branch.s: branch tests"
    set x 0

    gas_start "branch.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 E85F1FF5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 E85F1FEF\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 E81F1FE5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c E81F1FDF\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 E85F3FD5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 E85F3FCF\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 E8444000\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c E8444002\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 E8044000\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 E8044002\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 E840C000\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c E840C002\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 E040446C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 E040446E\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 E440446C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c E440446E\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 CB441FF5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 CB443FED\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 CB445FE5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c CB447FDD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 CB449FD5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 CB44BFCD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 CB44DFC5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c CB44FFBD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 CB441FB7\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 CB443FAF\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 CB445FA7\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c CB447F9F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 CB449F97\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 CB44BF8F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 CB44DF87\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c CB44FF7F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 CF4A1FF5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 CF4A3FED\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 CF4A5FE5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c CF4A7FDD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 CF4A9FD5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 CF4ABFCD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 CF4ADFC5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c CF4AFFBD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a0 CF4A1FB7\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a4 CF4A3FAF\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a8 CF4A5FA7\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ac CF4A7F9F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b0 CF4A9F97\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b4 CF4ABF8F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b8 CF4ADF87\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00bc CF4AFF7F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c0 80801FF5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c4 80803FED\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c8 80805FE5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00cc 80807FDD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d0 80809FD5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d4 8080BFCD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d8 8080DFC5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00dc 8080FFBD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e0 88801FB5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e4 88803FAD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e8 88805FA5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ec 88807F9D\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f0 88809F95\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f4 8880BF8D\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f8 8880DF85\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00fc 8880FF7D\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0100 80801F77\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0104 80803F6F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0108 80805F67\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 010c 80807F5F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0110 80809F57\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0114 8080BF4F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0118 8080DF47\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 011c 8080FF3F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0120 88801F37\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0124 88803F2F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0128 88805F27\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 012c 88807F1F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0130 88809F17\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0134 8880BF0F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0138 8880DF07\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 013c 8880FEFF\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0140 84801FF5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0144 84805FED\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0148 84807FE5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 014c 84809FDD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0150 8480BFD5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0154 8480DFCD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0158 8480FFC5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 015c 8C801FBD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0160 8C803FB5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0164 8C805FAD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0168 8C807FA5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 016c 8C809F9D\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0170 8C80BF95\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0174 8C80DF8D\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0178 8C80FE85\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 017c 84801F7F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0180 84803F77\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0184 84805F6F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0188 84807F67\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 018c 84809F5F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0190 8480BF57\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0194 8480DF4F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0198 8480FF47\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 019c 8C801F3F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01a0 8C803F37\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01a4 8C805F2F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01a8 8C807F27\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01ac 8C809F1F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01b0 8C80BF17\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01b4 8C80DF0F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01b8 8C80FF07\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01bc A0811FF5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01c0 A0813FED\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01c4 A0815FE5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01c8 A0817FDD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01cc A0819FD5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01d0 A081BFCD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01d4 A081DFC5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01d8 A081FFBD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01dc A8811FB5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01e0 A8813FAD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01e4 A8815FA5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01e8 A8817F9D\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01ec A8819F95\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01f0 A881BF8D\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01f4 A881DF85\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01f8 A881FF7D\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01fc A0811F77\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0200 A0813F6F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0204 A0815F67\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0208 A0817F5F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 020c A0819F57\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0210 A081BF4F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0214 A081DF47\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0218 A081FF3F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 021c A8811F37\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0220 A8813F2F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0224 A8815F27\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0228 A8817F1F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 022c A8819F17\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0230 A881BF0F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0234 A881DF07\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0238 A881FEFF\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 023c A49F1FF5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0240 A49F3FED\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0244 A49F5FE5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0248 A49F7FDD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 024c A49F9FD5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0250 A49FBFCD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0254 A49FDFC5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0258 A49FFFBD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 025c AC9F1FB5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0260 AC9F3FAD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0264 AC9F5FA5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0268 AC9F7F9D\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 026c AC9F9F95\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0270 AC9FBF8D\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0274 AC9FDF85\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0278 AC9FFC85\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 027c A49F1F77\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0280 A49F3F6F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0284 A49F5F67\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0288 A49F7F5F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 028c A49F9F57\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0290 A49FBF4F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0294 A49FDF47\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0298 A49FFF3F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 029c AC9F1F37\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02a0 AC9F3F2F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02a4 AC9F5F27\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02a8 AC9F7F1F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02ac AC9F9F17\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02b0 AC9FBF0F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02b4 AC9FDF07\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02b8 AC9FFEFF\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02bc C0045FF5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02c0 C004DFED\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02c4 C0045FE7\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02c8 C004DFDF\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02cc C4A45FD5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02d0 C4A4DFCD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02d4 C4A45FC7\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02d8 C4A4DFBF\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==183] then { pass $testname } else { fail $testname }
}

proc do_branch2 {} {
    set testname "branch2.s: branch tests"
    set x 0

    gas_start "branch2.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 C0045FF5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 C004DFED\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 C0045FE7\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c C004DFDF\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 C0047FD5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 C004FFCD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 C0047FC7\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c C004FFBF\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 C4A47FB5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 C4A4FFAD\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 C4A47FA7\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c C4A4FF9F\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 E8004005\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 E800400D\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 E8004F9D\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c E8004001\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 E8044001\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==17] then { pass $testname } else { fail $testname }
}

proc do_add {} {
    set testname "add.s: add tests"
    set x 0

    gas_start "add.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 08A40606\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 08A42606\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 08A44606\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 08A46606\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 08A48606\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 08A4A606\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 08A4C606\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 08A4E606\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 08A41606\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 08A43606\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 08A45606\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 08A47606\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 08A49606\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 08A4B606\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 08A4D606\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 08A4F606\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 08A40A06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 08A42A06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 08A44A06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 08A46A06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 08A48A06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 08A4AA06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 08A4CA06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 08A4EA06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 08A41A06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 08A43A06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 08A45A06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 08A47A06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 08A49A06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 08A4BA06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 08A4DA06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c 08A4FA06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 08A40E06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 08A42E06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 08A44E06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c 08A46E06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 08A48E06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 08A4AE06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 08A4CE06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c 08A4EE06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a0 08A41E06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a4 08A43E06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a8 08A45E06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ac 08A47E06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b0 08A49E06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b4 08A4BE06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b8 08A4DE06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00bc 08A4FE06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c0 08A40706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c4 08A42706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c8 08A44706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00cc 08A46706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d0 08A48706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d4 08A4A706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d8 08A4C706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00dc 08A4E706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e0 08A41706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e4 08A43706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e8 08A45706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ec 08A47706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f0 08A49706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f4 08A4B706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f8 08A4D706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00fc 08A4F706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0100 08A40F06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0104 08A42F06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0108 08A44F06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 010c 08A46F06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0110 08A48F06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0114 08A4AF06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0118 08A4CF06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 011c 08A4EF06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0120 08A41F06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0124 08A43F06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0128 08A45F06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 012c 08A47F06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0130 08A49F06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0134 08A4BF06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0138 08A4DF06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 013c 08A4FF06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0140 08A40A06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0144 08A42A06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0148 08A44A06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 014c 08A46A06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0150 08A48A06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0154 08A4AA06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0158 08A4CA06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 015c 08A4EA06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0160 08A41A06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0164 08A43A06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0168 08A45A06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 016c 08A47A06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0170 08A49A06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0174 08A4BA06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0178 08A4DA06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 017c 08A4FA06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0180 08A40E06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0184 08A42E06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0188 08A44E06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 018c 08A46E06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0190 08A48E06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0194 08A4AE06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0198 08A4CE06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 019c 08A4EE06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01a0 08A41E06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01a4 08A43E06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01a8 08A45E06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01ac 08A47E06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01b0 08A49E06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01b4 08A4BE06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01b8 08A4DE06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01bc 08A4FE06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01c0 08A40706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01c4 08A42706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01c8 08A44706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01cc 08A46706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01d0 08A48706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01d4 08A4A706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01d8 08A4C706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01dc 08A4E706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01e0 08A41706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01e4 08A43706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01e8 08A45706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01ec 08A47706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01f0 08A49706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01f4 08A4B706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01f8 08A4D706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01fc 08A4F706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0200 08A40F06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0204 08A42F06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0208 08A44F06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 020c 08A46F06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0210 08A48F06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0214 08A4AF06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0218 08A4CF06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 021c 08A4EF06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0220 08A41F06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0224 08A43F06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0228 08A45F06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 022c 08A47F06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0230 08A49F06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0234 08A4BF06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0238 08A4DF06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 023c 08A4FF06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==144] then { pass $testname } else { fail $testname }
}

proc do_add2 {} {
    set testname "add2.s: add2 tests"
    set x 0

    gas_start "add2.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 08A40626\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 08A42626\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 08A44626\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 08A46626\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 08A48626\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 08A4A626\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 08A4C626\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 08A4E626\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 08A41626\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 08A43626\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 08A45626\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 08A47626\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 08A49626\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 08A4B626\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 08A4D626\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 08A4F626\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 08A40A26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 08A42A26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 08A44A26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 08A46A26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 08A48A26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 08A4AA26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 08A4CA26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 08A4EA26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 08A41A26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 08A43A26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 08A45A26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 08A47A26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 08A49A26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 08A4BA26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 08A4DA26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c 08A4FA26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 08A40E26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 08A42E26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 08A44E26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c 08A46E26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 08A48E26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 08A4AE26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 08A4CE26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c 08A4EE26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a0 08A41E26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a4 08A43E26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a8 08A45E26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ac 08A47E26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b0 08A49E26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b4 08A4BE26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b8 08A4DE26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00bc 08A4FE26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c0 08A40726\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c4 08A42726\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c8 08A44726\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00cc 08A46726\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d0 08A48726\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d4 08A4A726\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d8 08A4C726\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00dc 08A4E726\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e0 08A41726\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e4 08A43726\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e8 08A45726\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ec 08A47726\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f0 08A49726\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f4 08A4B726\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f8 08A4D726\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00fc 08A4F726\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0100 08A40F26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0104 08A42F26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0108 08A44F26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 010c 08A46F26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0110 08A48F26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0114 08A4AF26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0118 08A4CF26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 011c 08A4EF26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0120 08A41F26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0124 08A43F26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0128 08A45F26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 012c 08A47F26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0130 08A49F26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0134 08A4BF26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0138 08A4DF26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 013c 08A4FF26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0140 08210601\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0144 08210721\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==82] then { pass $testname } else { fail $testname }
}

proc do_sh1add {} {
    set testname "sh1add.s: sh1add tests"
    set x 0

    gas_start "sh1add.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 08A40646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 08A42646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 08A44646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 08A46646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 08A48646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 08A4A646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 08A4C646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 08A4E646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 08A41646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 08A43646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 08A45646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 08A47646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 08A49646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 08A4B646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 08A4D646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 08A4F646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 08A40A46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 08A42A46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 08A44A46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 08A46A46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 08A48A46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 08A4AA46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 08A4CA46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 08A4EA46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 08A41A46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 08A43A46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 08A45A46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 08A47A46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 08A49A46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 08A4BA46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 08A4DA46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c 08A4FA46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 08A40E46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 08A42E46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 08A44E46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c 08A46E46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 08A48E46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 08A4AE46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 08A4CE46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c 08A4EE46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a0 08A41E46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a4 08A43E46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a8 08A45E46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ac 08A47E46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b0 08A49E46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b4 08A4BE46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b8 08A4DE46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00bc 08A4FE46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==48] then { pass $testname } else { fail $testname }
}

proc do_sh2add {} {
    set testname "sh2add.s: sh2add tests"
    set x 0

    gas_start "sh2add.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 08A40686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 08A42686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 08A44686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 08A46686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 08A48686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 08A4A686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 08A4C686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 08A4E686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 08A41686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 08A43686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 08A45686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 08A47686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 08A49686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 08A4B686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 08A4D686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 08A4F686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 08A40A86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 08A42A86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 08A44A86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 08A46A86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 08A48A86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 08A4AA86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 08A4CA86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 08A4EA86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 08A41A86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 08A43A86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 08A45A86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 08A47A86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 08A49A86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 08A4BA86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 08A4DA86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c 08A4FA86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 08A40E86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 08A42E86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 08A44E86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c 08A46E86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 08A48E86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 08A4AE86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 08A4CE86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c 08A4EE86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a0 08A41E86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a4 08A43E86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a8 08A45E86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ac 08A47E86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b0 08A49E86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b4 08A4BE86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b8 08A4DE86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00bc 08A4FE86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==48] then { pass $testname } else { fail $testname }
}

proc do_sh3add {} {
    set testname "sh3add.s: sh3add tests"
    set x 0

    gas_start "sh3add.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 08A406C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 08A426C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 08A446C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 08A466C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 08A486C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 08A4A6C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 08A4C6C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 08A4E6C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 08A416C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 08A436C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 08A456C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 08A476C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 08A496C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 08A4B6C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 08A4D6C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 08A4F6C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 08A40AC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 08A42AC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 08A44AC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 08A46AC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 08A48AC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 08A4AAC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 08A4CAC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 08A4EAC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 08A41AC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 08A43AC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 08A45AC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 08A47AC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 08A49AC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 08A4BAC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 08A4DAC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c 08A4FAC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 08A40EC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 08A42EC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 08A44EC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c 08A46EC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 08A48EC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 08A4AEC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 08A4CEC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c 08A4EEC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a0 08A41EC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a4 08A43EC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a8 08A45EC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ac 08A47EC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b0 08A49EC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b4 08A4BEC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b8 08A4DEC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00bc 08A4FEC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==48] then { pass $testname } else { fail $testname }
}

proc do_shladd {} {
    set testname "shladd.s: shladd tests"
    set x 0

    gas_start "shladd.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 08A40646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 08A42646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 08A44646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 08A46646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 08A48646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 08A4A646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 08A4C646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 08A4E646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 08A41646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 08A43646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 08A45646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 08A47646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 08A49646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 08A4B646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 08A4D646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 08A4F646\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 08A40A46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 08A42A46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 08A44A46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 08A46A46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 08A48A46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 08A4AA46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 08A4CA46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 08A4EA46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 08A41A46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 08A43A46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 08A45A46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 08A47A46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 08A49A46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 08A4BA46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 08A4DA46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c 08A4FA46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 08A40E46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 08A42E46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 08A44E46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c 08A46E46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 08A48E46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 08A4AE46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 08A4CE46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c 08A4EE46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a0 08A41E46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a4 08A43E46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a8 08A45E46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ac 08A47E46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b0 08A49E46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b4 08A4BE46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b8 08A4DE46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00bc 08A4FE46\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c0 08A40686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c4 08A42686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c8 08A44686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00cc 08A46686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d0 08A48686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d4 08A4A686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d8 08A4C686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00dc 08A4E686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e0 08A41686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e4 08A43686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e8 08A45686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ec 08A47686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f0 08A49686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f4 08A4B686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f8 08A4D686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00fc 08A4F686\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0100 08A40A86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0104 08A42A86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0108 08A44A86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 010c 08A46A86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0110 08A48A86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0114 08A4AA86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0118 08A4CA86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 011c 08A4EA86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0120 08A41A86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0124 08A43A86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0128 08A45A86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 012c 08A47A86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0130 08A49A86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0134 08A4BA86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0138 08A4DA86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 013c 08A4FA86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0140 08A40E86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0144 08A42E86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0148 08A44E86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 014c 08A46E86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0150 08A48E86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0154 08A4AE86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0158 08A4CE86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 015c 08A4EE86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0160 08A41E86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0164 08A43E86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0168 08A45E86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 016c 08A47E86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0170 08A49E86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0174 08A4BE86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0178 08A4DE86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 017c 08A4FE86\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0180 08A406C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0184 08A426C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0188 08A446C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 018c 08A466C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0190 08A486C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0194 08A4A6C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0198 08A4C6C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 019c 08A4E6C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01a0 08A416C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01a4 08A436C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01a8 08A456C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01ac 08A476C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01b0 08A496C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01b4 08A4B6C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01b8 08A4D6C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01bc 08A4F6C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01c0 08A40AC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01c4 08A42AC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01c8 08A44AC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01cc 08A46AC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01d0 08A48AC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01d4 08A4AAC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01d8 08A4CAC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01dc 08A4EAC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01e0 08A41AC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01e4 08A43AC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01e8 08A45AC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01ec 08A47AC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01f0 08A49AC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01f4 08A4BAC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01f8 08A4DAC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01fc 08A4FAC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0200 08A40EC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0204 08A42EC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0208 08A44EC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 020c 08A46EC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0210 08A48EC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0214 08A4AEC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0218 08A4CEC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 021c 08A4EEC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0220 08A41EC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0224 08A43EC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0228 08A45EC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 022c 08A47EC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0230 08A49EC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0234 08A4BEC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0238 08A4DEC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 023c 08A4FEC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==144] then { pass $testname } else { fail $testname }
}

proc do_shladd2 {} {
    set testname "shladd2.s: shladd2 tests"
    set x 0

    gas_start "shladd2.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 08A40666\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 08A42666\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 08A44666\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 08A46666\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 08A48666\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 08A4A666\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 08A4C666\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 08A4E666\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 08A41666\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 08A43666\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 08A45666\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 08A47666\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 08A49666\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 08A4B666\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 08A4D666\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 08A4F666\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 08A40A66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 08A42A66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 08A44A66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 08A46A66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 08A48A66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 08A4AA66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 08A4CA66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 08A4EA66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 08A41A66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 08A43A66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 08A45A66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 08A47A66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 08A49A66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 08A4BA66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 08A4DA66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c 08A4FA66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 08A40E66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 08A42E66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 08A44E66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c 08A46E66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 08A48E66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 08A4AE66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 08A4CE66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c 08A4EE66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a0 08A41E66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a4 08A43E66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a8 08A45E66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ac 08A47E66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b0 08A49E66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b4 08A4BE66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b8 08A4DE66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00bc 08A4FE66\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c0 08A406A6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c4 08A426A6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c8 08A446A6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00cc 08A466A6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d0 08A486A6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d4 08A4A6A6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d8 08A4C6A6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00dc 08A4E6A6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e0 08A416A6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e4 08A436A6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e8 08A456A6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ec 08A476A6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f0 08A496A6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f4 08A4B6A6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f8 08A4D6A6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00fc 08A4F6A6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0100 08A40AA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0104 08A42AA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0108 08A44AA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 010c 08A46AA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0110 08A48AA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0114 08A4AAA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0118 08A4CAA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 011c 08A4EAA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0120 08A41AA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0124 08A43AA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0128 08A45AA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 012c 08A47AA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0130 08A49AA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0134 08A4BAA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0138 08A4DAA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 013c 08A4FAA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0140 08A40EA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0144 08A42EA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0148 08A44EA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 014c 08A46EA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0150 08A48EA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0154 08A4AEA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0158 08A4CEA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 015c 08A4EEA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0160 08A41EA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0164 08A43EA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0168 08A45EA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 016c 08A47EA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0170 08A49EA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0174 08A4BEA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0178 08A4DEA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 017c 08A4FEA6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0180 08A406E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0184 08A426E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0188 08A446E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 018c 08A466E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0190 08A486E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0194 08A4A6E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0198 08A4C6E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 019c 08A4E6E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01a0 08A416E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01a4 08A436E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01a8 08A456E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01ac 08A476E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01b0 08A496E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01b4 08A4B6E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01b8 08A4D6E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01bc 08A4F6E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01c0 08A40AE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01c4 08A42AE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01c8 08A44AE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01cc 08A46AE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01d0 08A48AE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01d4 08A4AAE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01d8 08A4CAE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01dc 08A4EAE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01e0 08A41AE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01e4 08A43AE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01e8 08A45AE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01ec 08A47AE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01f0 08A49AE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01f4 08A4BAE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01f8 08A4DAE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01fc 08A4FAE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0200 08A40EE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0204 08A42EE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0208 08A44EE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 020c 08A46EE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0210 08A48EE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0214 08A4AEE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0218 08A4CEE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 021c 08A4EEE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0220 08A41EE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0224 08A43EE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0228 08A45EE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 022c 08A47EE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0230 08A49EE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0234 08A4BEE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0238 08A4DEE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 023c 08A4FEE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==144] then { pass $testname } else { fail $testname }
}

proc do_sub {} {
    set testname "sub.s: sub tests"
    set x 0

    gas_start "sub.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 08A40406\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 08A42406\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 08A44406\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 08A46406\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 08A48406\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 08A4A406\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 08A4C406\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 08A4E406\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 08A41406\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 08A43406\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 08A45406\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 08A47406\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 08A49406\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 08A4B406\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 08A4D406\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 08A4F406\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 08A40C06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 08A42C06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 08A44C06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 08A46C06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 08A48C06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 08A4AC06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 08A4CC06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 08A4EC06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 08A41C06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 08A43C06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 08A45C06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 08A47C06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 08A49C06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 08A4BC06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 08A4DC06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c 08A4FC06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 08A40506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 08A42506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 08A44506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c 08A46506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 08A48506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 08A4A506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 08A4C506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c 08A4E506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a0 08A41506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a4 08A43506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a8 08A45506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ac 08A47506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b0 08A49506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b4 08A4B506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b8 08A4D506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00bc 08A4F506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c0 08A40D06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c4 08A42D06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c8 08A44D06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00cc 08A46D06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d0 08A48D06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d4 08A4AD06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d8 08A4CD06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00dc 08A4ED06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e0 08A41D06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e4 08A43D06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e8 08A45D06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ec 08A47D06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f0 08A49D06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f4 08A4BD06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f8 08A4DD06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00fc 08A4FD06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0100 08A404C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0104 08A424C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0108 08A444C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 010c 08A464C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0110 08A484C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0114 08A4A4C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0118 08A4C4C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 011c 08A4E4C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0120 08A414C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0124 08A434C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0128 08A454C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 012c 08A474C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0130 08A494C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0134 08A4B4C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0138 08A4D4C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 013c 08A4F4C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0140 08A40CC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0144 08A42CC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0148 08A44CC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 014c 08A46CC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0150 08A48CC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0154 08A4ACC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0158 08A4CCC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 015c 08A4ECC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0160 08A41CC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0164 08A43CC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0168 08A45CC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 016c 08A47CC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0170 08A49CC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0174 08A4BCC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0178 08A4DCC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 017c 08A4FCC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0180 08A40C06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0184 08A42C06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0188 08A44C06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 018c 08A46C06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0190 08A48C06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0194 08A4AC06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0198 08A4CC06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 019c 08A4EC06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01a0 08A41C06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01a4 08A43C06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01a8 08A45C06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01ac 08A47C06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01b0 08A49C06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01b4 08A4BC06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01b8 08A4DC06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01bc 08A4FC06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01c0 08A40506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01c4 08A42506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01c8 08A44506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01cc 08A46506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01d0 08A48506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01d4 08A4A506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01d8 08A4C506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01dc 08A4E506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01e0 08A41506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01e4 08A43506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01e8 08A45506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01ec 08A47506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01f0 08A49506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01f4 08A4B506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01f8 08A4D506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01fc 08A4F506\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0200 08A40D06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0204 08A42D06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0208 08A44D06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 020c 08A46D06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0210 08A48D06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0214 08A4AD06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0218 08A4CD06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 021c 08A4ED06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0220 08A41D06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0224 08A43D06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0228 08A45D06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 022c 08A47D06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0230 08A49D06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0234 08A4BD06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0238 08A4DD06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 023c 08A4FD06\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0240 08A404C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0244 08A424C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0248 08A444C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 024c 08A464C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0250 08A484C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0254 08A4A4C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0258 08A4C4C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 025c 08A4E4C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0260 08A414C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0264 08A434C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0268 08A454C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 026c 08A474C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0270 08A494C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0274 08A4B4C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0278 08A4D4C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 027c 08A4F4C6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0280 08A40CC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0284 08A42CC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0288 08A44CC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 028c 08A46CC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0290 08A48CC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0294 08A4ACC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0298 08A4CCC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 029c 08A4ECC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02a0 08A41CC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02a4 08A43CC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02a8 08A45CC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02ac 08A47CC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02b0 08A49CC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02b4 08A4BCC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02b8 08A4DCC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 02bc 08A4FCC6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==176] then { pass $testname } else { fail $testname }
}

proc do_sub2 {} {
    set testname "sub2.s: sub2 tests"
    set x 0

    gas_start "sub2.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 08A40426\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 08A42426\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 08A44426\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 08A46426\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 08A48426\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 08A4A426\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 08A4C426\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 08A4E426\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 08A41426\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 08A43426\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 08A45426\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 08A47426\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 08A49426\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 08A4B426\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 08A4D426\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 08A4F426\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 08A40C26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 08A42C26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 08A44C26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 08A46C26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 08A48C26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 08A4AC26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 08A4CC26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 08A4EC26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 08A41C26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 08A43C26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 08A45C26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 08A47C26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 08A49C26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 08A4BC26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 08A4DC26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c 08A4FC26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 08A40526\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 08A42526\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 08A44526\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c 08A46526\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 08A48526\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 08A4A526\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 08A4C526\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c 08A4E526\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a0 08A41526\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a4 08A43526\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a8 08A45526\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ac 08A47526\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b0 08A49526\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b4 08A4B526\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b8 08A4D526\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00bc 08A4F526\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c0 08A40D26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c4 08A42D26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c8 08A44D26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00cc 08A46D26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d0 08A48D26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d4 08A4AD26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d8 08A4CD26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00dc 08A4ED26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e0 08A41D26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e4 08A43D26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e8 08A45D26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ec 08A47D26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f0 08A49D26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f4 08A4BD26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f8 08A4DD26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00fc 08A4FD26\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0100 08A404E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0104 08A424E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0108 08A444E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 010c 08A464E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0110 08A484E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0114 08A4A4E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0118 08A4C4E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 011c 08A4E4E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0120 08A414E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0124 08A434E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0128 08A454E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 012c 08A474E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0130 08A494E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0134 08A4B4E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0138 08A4D4E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 013c 08A4F4E6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0140 08A40CE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0144 08A42CE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0148 08A44CE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 014c 08A46CE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0150 08A48CE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0154 08A4ACE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0158 08A4CCE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 015c 08A4ECE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0160 08A41CE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0164 08A43CE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0168 08A45CE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 016c 08A47CE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0170 08A49CE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0174 08A4BCE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0178 08A4DCE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 017c 08A4FCE6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0180 08210401\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0184 08210521\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==98] then { pass $testname } else { fail $testname }
}

proc do_ds {} {
    set testname "ds.s: ds tests"
    set x 0

    gas_start "ds.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 08A40446\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 08A42446\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 08A44446\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 08A46446\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 08A48446\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 08A4A446\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 08A4C446\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 08A4E446\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 08A41446\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 08A43446\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 08A45446\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 08A47446\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 08A49446\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 08A4B446\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 08A4D446\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 08A4F446\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==16] then { pass $testname } else { fail $testname }
}

proc do_comclr {} {
    set testname "comclr.s: comclr tests"
    set x 0

    gas_start "comclr.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 08A40886\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 08A42886\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 08A44886\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 08A46886\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 08A48886\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 08A4A886\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 08A4C886\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 08A4E886\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 08A41886\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 08A43886\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 08A45886\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 08A47886\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 08A49886\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 08A4B886\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 08A4D886\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 08A4F886\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 90A600F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 90A620F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 90A640F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 90A660F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 90A680F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 90A6A0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 90A6C0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 90A6E0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 90A610F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 90A630F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 90A650F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 90A670F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 90A690F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 90A6B0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 90A6D0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c 90A6F0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==32] then { pass $testname } else { fail $testname }
}

proc do_logical {} {
    set testname "logical.s: logical tests"
    set x 0

    gas_start "logical.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 08A40246\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 08A42246\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 08A44246\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 08A46246\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 08A4E246\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 08A41246\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 08A43246\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 08A45246\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 08A47246\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 08A4F246\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 08A40286\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 08A42286\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 08A44286\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 08A46286\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 08A4E286\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 08A41286\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 08A43286\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 08A45286\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 08A47286\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 08A4F286\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 08A40206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 08A42206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 08A44206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 08A46206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 08A4E206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 08A41206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 08A43206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 08A45206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 08A47206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 08A4F206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 08A40006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c 08A42006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 08A44006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 08A46006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 08A4E006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c 08A41006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 08A43006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 08A45006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 08A47006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c 08A4F006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==40] then { pass $testname } else { fail $testname }
}

proc do_unit {} {
    set testname "unit.s: unit tests"
    set x 0

    gas_start "unit.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 08A40386\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 08A44386\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 08A46386\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 08A41386\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 08A45386\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 08A47386\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 08A40986\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 08A44986\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 08A46986\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 08A48986\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 08A4C986\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 08A4E986\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 08A41986\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 08A45986\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 08A47986\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 08A49986\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 08A4D986\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 08A4F986\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 08A409C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 08A449C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 08A469C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 08A489C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 08A4C9C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 08A4E9C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 08A419C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 08A459C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 08A479C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 08A499C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 08A4D9C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 08A4F9C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 08A409C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c 08A449C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 08A469C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 08A489C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 08A4C9C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c 08A4E9C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 08A419C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 08A459C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 08A479C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c 08A499C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a0 08A4D9C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a4 08A4F9C6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==42] then { pass $testname } else { fail $testname }
}

proc do_unit2 {} {
    set testname "unit2.s: unit2 tests"
    set x 0

    gas_start "unit2.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 08A403A6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 08A443A6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 08A463A6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 08A413A6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 08A453A6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 08A473A6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 08A409A6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 08A449A6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 08A469A6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 08A489A6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 08A4C9A6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 08A4E9A6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 08A419A6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 08A459A6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 08A479A6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 08A499A6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 08A4D9A6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 08A4F9A6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 08A409E6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 08A449E6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 08A469E6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 08A489E6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 08A4C9E6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 08A4E9E6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 08A419E6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 08A459E6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 08A479E6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 08A499E6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 08A4D9E6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 08A4F9E6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==30] then { pass $testname } else { fail $testname }
}

proc do_dcor {} {
    set testname "dcor.s: dcor tests"
    set x 0

    gas_start "dcor.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 08800B85\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 08804B85\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 08806B85\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 08808B85\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 0880CB85\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 0880EB85\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 08801B85\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 08805B85\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 08807B85\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 08809B85\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 0880DB85\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 0880FB85\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 08800BC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 08804BC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 08806BC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 08808BC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 0880CBC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 0880EBC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 08801BC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 08805BC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 08807BC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 08809BC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 0880DBC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 0880FBC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 08800BC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 08804BC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 08806BC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 08808BC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 0880CBC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 0880EBC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 08801BC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c 08805BC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 08807BC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 08809BC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 0880DBC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c 0880FBC5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==36] then { pass $testname } else { fail $testname }
}

proc do_dcor2 {} {
    set testname "dcor2.s: dcor2 tests"
    set x 0

    gas_start "dcor2.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 08800BA5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 08804BA5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 08806BA5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 08808BA5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 0880CBA5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 0880EBA5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 08801BA5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 08805BA5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 08807BA5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 08809BA5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 0880DBA5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 0880FBA5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 08800BE5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 08804BE5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 08806BE5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 08808BE5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 0880CBE5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 0880EBE5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 08801BE5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 08805BE5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 08807BE5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 08809BE5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 0880DBE5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 0880FBE5\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==24] then { pass $testname } else { fail $testname }
}

proc do_addi {} {
    set testname "addi.s: addi tests"
    set x 0

    gas_start "addi.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 B4A600F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 B4A620F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 B4A640F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c B4A660F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 B4A680F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 B4A6A0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 B4A6C0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c B4A6E0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 B4A610F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 B4A630F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 B4A650F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c B4A670F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 B4A690F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 B4A6B0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 B4A6D0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c B4A6F0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 B4A608F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 B4A628F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 B4A648F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c B4A668F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 B4A688F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 B4A6A8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 B4A6C8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c B4A6E8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 B4A618F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 B4A638F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 B4A658F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c B4A678F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 B4A698F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 B4A6B8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 B4A6D8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c B4A6F8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 B0A600F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 B0A620F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 B0A640F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c B0A660F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 B0A680F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 B0A6A0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 B0A6C0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c B0A6E0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a0 B0A610F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a4 B0A630F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a8 B0A650F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ac B0A670F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b0 B0A690F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b4 B0A6B0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b8 B0A6D0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00bc B0A6F0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c0 B0A608F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c4 B0A628F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c8 B0A648F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00cc B0A668F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d0 B0A688F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d4 B0A6A8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d8 B0A6C8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00dc B0A6E8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e0 B0A618F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e4 B0A638F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e8 B0A658F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ec B0A678F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f0 B0A698F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f4 B0A6B8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f8 B0A6D8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00fc B0A6F8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0100 B4A608F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0104 B4A628F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0108 B4A648F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 010c B4A668F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0110 B4A688F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0114 B4A6A8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0118 B4A6C8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 011c B4A6E8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0120 B4A618F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0124 B4A638F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0128 B4A658F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 012c B4A678F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0130 B4A698F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0134 B4A6B8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0138 B4A6D8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 013c B4A6F8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0140 B0A600F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0144 B0A620F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0148 B0A640F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 014c B0A660F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0150 B0A680F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0154 B0A6A0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0158 B0A6C0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 015c B0A6E0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0160 B0A610F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0164 B0A630F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0168 B0A650F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 016c B0A670F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0170 B0A690F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0174 B0A6B0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0178 B0A6D0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 017c B0A6F0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0180 B0A608F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0184 B0A628F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0188 B0A648F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 018c B0A668F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0190 B0A688F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0194 B0A6A8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0198 B0A6C8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 019c B0A6E8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01a0 B0A618F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01a4 B0A638F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01a8 B0A658F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01ac B0A678F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01b0 B0A698F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01b4 B0A6B8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01b8 B0A6D8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 01bc B0A6F8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==112] then { pass $testname } else { fail $testname }
}

proc do_subi {} {
    set testname "subi.s: subi tests"
    set x 0

    gas_start "subi.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 94A600F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 94A620F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 94A640F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 94A660F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 94A680F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 94A6A0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 94A6C0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 94A6E0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 94A610F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 94A630F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 94A650F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 94A670F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 94A690F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 94A6B0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 94A6D0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 94A6F0F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 94A608F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 94A628F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 94A648F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 94A668F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 94A688F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 94A6A8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 94A6C8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 94A6E8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 94A618F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 94A638F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 94A658F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 94A678F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 94A698F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 94A6B8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 94A6D8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c 94A6F8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 94A608F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 94A628F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 94A648F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c 94A668F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 94A688F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 94A6A8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 94A6C8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c 94A6E8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a0 94A618F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a4 94A638F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a8 94A658F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ac 94A678F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b0 94A698F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b4 94A6B8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b8 94A6D8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00bc 94A6F8F6\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==48] then { pass $testname } else { fail $testname }
}

proc do_shift {} {
    set testname "shift.s: shift tests"
    set x 0

    gas_start "shift.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 D0A40006\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 D0A42006\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 D0A44006\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c D0A46006\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 D0A48006\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 D0A4A006\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 D0A4C006\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c D0A4E006\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 D0A40B46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 D0A42B46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 D0A44B46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c D0A46B46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 D0A48B46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 D0A4AB46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 D0A4CB46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c D0A4EB46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==16] then { pass $testname } else { fail $testname }
}

proc do_shift2 {} {
    set testname "shift2.s: shift tests"
    set x 0

    gas_start "shift2.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 D0A40006\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 D0A42006\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 D0A44006\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c D0A46006\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 D0A48006\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 D0A4A006\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 D0A4C006\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c D0A4E006\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 D0A40B46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 D0A42B46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 D0A44B46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c D0A46B46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 D0A48B46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 D0A4AB46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 D0A4CB46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c D0A4EB46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==16] then { pass $testname } else { fail $testname }
}

proc do_shift3 {} {
    set testname "shift3.s: shift3 tests"
    set x 0

    gas_start "shift3.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 D0A40206\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 D0A42206\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 D0A44206\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c D0A46206\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 D0A48206\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 D0A4A206\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 D0A4C206\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c D0A4E206\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 D0A40F46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 D0A42F46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 D0A44F46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c D0A46F46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 D0A48F46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 D0A4AF46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 D0A4CF46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c D0A4EF46\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==16] then { pass $testname } else { fail $testname }
}

proc do_extract {} {
    set testname "extract.s: extract tests"
    set x 0

    gas_start "extract.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 D08618B6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 D08638B6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 D08658B6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c D08678B6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 D08698B6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 D086B8B6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 D086D8B6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c D086F8B6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 D0861CB6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 D0863CB6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 D0865CB6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c D0867CB6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 D0869CB6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 D086BCB6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 D086DCB6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c D086FCB6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 D086101B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 D086301B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 D086501B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c D086701B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 D086901B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 D086B01B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 D086D01B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c D086F01B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 D086141B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 D086341B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 D086541B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c D086741B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 D086941B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 D086B41B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 D086D41B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c D086F41B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==32] then { pass $testname } else { fail $testname }
}

proc do_extract2 {} {
    set testname "extract2.s: extract2 tests"
    set x 0

    gas_start "extract2.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 D08618B6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 D08638B6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 D08658B6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c D08678B6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 D08698B6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 D086B8B6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 D086D8B6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c D086F8B6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 D0861CB6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 D0863CB6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 D0865CB6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c D0867CB6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 D0869CB6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 D086BCB6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 D086DCB6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c D086FCB6\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 D086101B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 D086301B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 D086501B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c D086701B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 D086901B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 D086B01B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 D086D01B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c D086F01B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 D086141B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 D086341B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 D086541B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c D086741B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 D086941B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 D086B41B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 D086D41B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c D086F41B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==32] then { pass $testname } else { fail $testname }
}

proc do_extract3 {} {
    set testname "extract3.s: extract3 tests"
    set x 0

    gas_start "extract3.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 D886015B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 D886215B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 D886415B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c D886615B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 D886815B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 D886A15B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 D886C15B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c D886E15B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 D886055B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 D886255B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 D886455B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c D886655B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 D886855B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 D886A55B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 D886C55B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c D886E55B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 D086121B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 D086321B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 D086521B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c D086721B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 D086921B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 D086B21B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 D086D21B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c D086F21B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 D086161B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 D086361B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 D086561B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c D086761B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 D086961B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 D086B61B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 D086D61B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c D086F61B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==32] then { pass $testname } else { fail $testname }
}

proc do_deposit {} {
    set testname "deposit.s: deposit tests"
    set x 0

    gas_start "deposit.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 D4C40B56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 D4C42B56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 D4C44B56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c D4C46B56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 D4C48B56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 D4C4AB56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 D4C4CB56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c D4C4EB56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 D4C40F56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 D4C42F56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 D4C44F56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c D4C46F56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 D4C48F56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 D4C4AF56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 D4C4CF56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c D4C4EF56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 D4C4001B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 D4C4201B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 D4C4401B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c D4C4601B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 D4C4801B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 D4C4A01B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 D4C4C01B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c D4C4E01B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 D4C4041B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 D4C4241B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 D4C4441B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c D4C4641B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 D4C4841B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 D4C4A41B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 D4C4C41B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c D4C4E41B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 D4DF141B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 D4DF341B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 D4DF541B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c D4DF741B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 D4DF941B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 D4DFB41B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 D4DFD41B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c D4DFF41B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a0 D4DF101B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a4 D4DF301B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a8 D4DF501B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ac D4DF701B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b0 D4DF901B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b4 D4DFB01B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b8 D4DFD01B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00bc D4DFF01B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c0 D4DF1F76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c4 D4DF3F76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c8 D4DF5F76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00cc D4DF7F76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d0 D4DF9F76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d4 D4DFBF76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d8 D4DFDF76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00dc D4DFFF76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e0 D4DF1B76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e4 D4DF3B76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e8 D4DF5B76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ec D4DF7B76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f0 D4DF9B76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f4 D4DFBB76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f8 D4DFDB76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00fc D4DFFB76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==64] then { pass $testname } else { fail $testname }
}

proc do_deposit2 {} {
    set testname "deposit2.s: deposit2 tests"
    set x 0

    gas_start "deposit2.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 D4C40B56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 D4C42B56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 D4C44B56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c D4C46B56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 D4C48B56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 D4C4AB56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 D4C4CB56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c D4C4EB56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 D4C40F56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 D4C42F56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 D4C44F56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c D4C46F56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 D4C48F56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 D4C4AF56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 D4C4CF56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c D4C4EF56\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 D4C4001B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 D4C4201B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 D4C4401B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c D4C4601B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 D4C4801B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 D4C4A01B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 D4C4C01B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c D4C4E01B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 D4C4041B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 D4C4241B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 D4C4441B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c D4C4641B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 D4C4841B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 D4C4A41B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 D4C4C41B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c D4C4E41B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 D4DF141B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 D4DF341B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 D4DF541B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c D4DF741B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 D4DF941B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 D4DFB41B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 D4DFD41B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c D4DFF41B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a0 D4DF101B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a4 D4DF301B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a8 D4DF501B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ac D4DF701B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b0 D4DF901B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b4 D4DFB01B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b8 D4DFD01B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00bc D4DFF01B\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c0 D4DF1F76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c4 D4DF3F76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c8 D4DF5F76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00cc D4DF7F76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d0 D4DF9F76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d4 D4DFBF76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d8 D4DFDF76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00dc D4DFFF76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e0 D4DF1B76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e4 D4DF3B76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e8 D4DF5B76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ec D4DF7B76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f0 D4DF9B76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f4 D4DFBB76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f8 D4DFDB76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00fc D4DFFB76\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==64] then { pass $testname } else { fail $testname }
}

proc do_deposit3 {} {
    set testname "deposit3.s: deposit3 tests"
    set x 0

    gas_start "deposit3.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 F0C40ABB\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 F0C42ABB\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 F0C44ABB\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c F0C46ABB\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 F0C48ABB\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 F0C4AABB\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 F0C4CABB\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c F0C4EABB\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 F0C40EBB\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 F0C42EBB\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 F0C44EBB\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c F0C46EBB\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 F0C48EBB\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 F0C4AEBB\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 F0C4CEBB\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c F0C4EEBB\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 D4C4021B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 D4C4221B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 D4C4421B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c D4C4621B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 D4C4821B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 D4C4A21B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 D4C4C21B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c D4C4E21B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 D4C4061B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 D4C4261B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 D4C4461B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c D4C4661B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 D4C4861B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 D4C4A61B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 D4C4C61B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c D4C4E61B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 D4DF161B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 D4DF361B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 D4DF561B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c D4DF761B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 D4DF961B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 D4DFB61B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 D4DFD61B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c D4DFF61B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a0 D4DF121B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a4 D4DF321B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a8 D4DF521B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ac D4DF721B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b0 D4DF921B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b4 D4DFB21B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b8 D4DFD21B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00bc D4DFF21B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c0 F4DF0EBC\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c4 F4DF2EBC\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c8 F4DF4EBC\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00cc F4DF6EBC\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d0 F4DF8EBC\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d4 F4DFAEBC\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d8 F4DFCEBC\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00dc F4DFEEBC\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e0 F4DF0ABC\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e4 F4DF2ABC\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e8 F4DF4ABC\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ec F4DF6ABC\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f0 F4DF8ABC\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f4 F4DFAABC\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f8 F4DFCABC\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00fc F4DFEABC\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==64] then { pass $testname } else { fail $testname }
}

proc do_system {} {
    set testname "system.s: system tests"
    set x 0

    gas_start "system.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 00018005\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 00000C00\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 00000CA0\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 00050D64\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 00050E64\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 00041860\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 00A010A4\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 00041820\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 01441840\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 000004A4\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 014008A4\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 00000400\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 00100400\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 140004D2\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 04A61187\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 04A13187\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 04A611C7\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 04A131C7\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 04A41346\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 04A41366\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 04A41306\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 04A41040\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 04A42040\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 04A41000\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 04A42000\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==25] then { pass $testname } else { fail $testname }
}

proc do_system2 {} {
    set testname "system2.s: system2 tests"
    set x 0

    gas_start "system2.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 00000C00\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 00000CA0\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 039B0D64\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 039B0E64\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 016048A4\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 04A61187\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 04A13187\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 04A611C7\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 04A131C7\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==9] then { pass $testname } else { fail $testname }
}

proc do_purge {} {
    set testname "purge.s: purge tests"
    set x 0

    gas_start "purge.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 04A41200\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 04A41220\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 04A42200\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 04A42220\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 04A41240\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 04A41260\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 04A42240\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 04A42260\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 04A41380\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 04A413A0\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 04A41280\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 04A412A0\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 04A42280\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 04A422A0\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 04A412C0\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 04A412E0\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 04A422C0\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 04A422E0\[^\n]*\n"	{ set x [expr $x+1] }

	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==18] then { pass $testname } else { fail $testname }
}

proc do_purge2 {} {
    set testname "purge2.s: purge2 tests"
    set x 0

    gas_start "purge2.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 04A41600\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 04A41620\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 04A42600\[^\n]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 04A42620\[^\n]*\n"	{ set x [expr $x+1] }

	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==4] then { pass $testname } else { fail $testname }
}

proc do_fp_misc {} {
    set testname "fp_misc.s: fp_misc tests"
    set x 0

    gas_start "fp_misc.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 30002420\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==1] then { pass $testname } else { fail $testname }
}

proc do_fmem {} {
    set testname "fmem.s: fmem tests"
    set x 0

    gas_start "fmem.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 24A40006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 24A42006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 24A40026\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 24A42026\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 2CA40006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 2CA42006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 2CA40026\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 2CA42026\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 24A40206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 24A42206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 24A40226\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 24A42226\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 2CA40206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 2CA42206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 2CA40226\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 2CA42226\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 3CA40206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 3CA42206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 3CA40226\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 3CA42226\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 24A01006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 24A03026\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 24A01026\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 2CA01006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 2CA03026\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 2CA01026\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 24A01206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 24A03226\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 24A01226\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 2CA01206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 2CA03226\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c 2CA01226\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 3CA01206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 3CA03226\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 3CA01226\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==35] then { pass $testname } else { fail $testname }
}

proc do_fp_comp {} {
    set testname "fp_comp.s: fp_comp tests"
    set x 0

    gas_start "fp_comp.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 30A0400A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 30A0480A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 30A0580A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 32804018\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 32804818\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 30A0600A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 30A0680A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 30A0780A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 32806018\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 32806818\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 30A0800A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 30A0880A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 30A0980A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 32808018\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 32808818\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 30A0A00A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 30A0A80A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 30A0B80A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 3280A018\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 3280A818\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 3088060C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 30880E0C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 30881E0C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 3298061C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 32980E1C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 32981E1C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 3088260C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 30882E0C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 30883E0C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 3298261C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 32982E1C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c 32983E1C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 3088460C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 30884E0C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 30885E0C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c 3298461C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 32984E1C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 32985E1C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 3088660C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c 30886E0C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a0 30887E0C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a4 3298661C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a8 32986E1C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ac 32987E1C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b0 3088860C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b4 30888E0C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b8 30889E0C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00bc 3298861C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c0 32988E1C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c4 32989E1C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c8 180120E2\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00cc 1A11A4D2\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d0 980120E2\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d4 9A11A4D2\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d8 38854706\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==55] then { pass $testname } else { fail $testname }
}

proc do_fp_comp2 {} {
    set testname "fp_comp2.s: fp_comp2 tests"
    set x 0

    gas_start "fp_comp2.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 B8AA638E\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 B8AA6A0E\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 BA5B2595\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c BA5B2C15\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 B8AA63AE\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 B8AA6A2E\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 BA5B25B5\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c BA5B2C35\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 38A0C04A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 30A0C80A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 30A0D80A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 3A80C098\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 3280C818\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 38A0E04A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 30A0E80A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 30A0F80A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 3A80E098\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 3280E818\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==18] then { pass $testname } else { fail $testname }
}

proc do_fp_conv {} {
    set testname "fp_conv.s: fp_conv tests"
    set x 0

    gas_start "fp_conv.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 30A0020A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 30A0220A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 30A0620A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 30A00A0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 30A02A0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 30A06A0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 30A01A0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 30A03A0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 30A07A0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 32800218\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 32802218\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 32806218\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 32800A18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 32802A18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 32806A18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 32801A18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 32803A18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 32807A18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 30A0820A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 30A0A20A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 30A0E20A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 30A08A0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 30A0AA0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 30A0EA0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 30A09A0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 30A0BA0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 30A0FA0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 32808218\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 3280A218\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 3280E218\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 32808A18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c 3280AA18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 3280EA18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 32809A18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 3280BA18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c 3280FA18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 30A1020A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 30A1220A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 30A1620A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c 30A10A0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a0 30A12A0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a4 30A16A0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a8 30A11A0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ac 30A13A0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b0 30A17A0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b4 32810218\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b8 32812218\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00bc 32816218\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c0 32810A18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c4 32812A18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c8 32816A18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00cc 32811A18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d0 32813A18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d4 32817A18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d8 30A1820A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00dc 30A1A20A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e0 30A1E20A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e4 30A18A0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e8 30A1AA0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ec 30A1EA0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f0 30A19A0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f4 30A1BA0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f8 30A1FA0A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00fc 32818218\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0100 3281A218\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0104 3281E218\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0108 32818A18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 010c 3281AA18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0110 3281EA18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0114 32819A18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0118 3281BA18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 011c 3281FA18\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==72] then { pass $testname } else { fail $testname }
}

proc do_fp_fcmp {} {
    set testname "fp_fcmp.s: fp_fcmp tests"
    set x 0

    gas_start "fp_fcmp.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 30850400\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 30850401\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 30850402\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 30850403\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 30850404\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 30850405\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 30850406\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 30850407\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 30850408\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 30850409\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 3085040A\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 3085040B\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 3085040C\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 3085040D\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 3085040E\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 3085040F\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 30850410\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 30850411\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 30850412\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 30850413\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 30850414\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 30850415\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 30850416\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 30850417\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 30850418\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 30850419\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 3085041A\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 3085041B\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 3085041C\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 3085041D\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 3085041E\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c 3085041F\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 30850C00\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 30850C01\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 30850C02\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c 30850C03\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 30850C04\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 30850C05\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 30850C06\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c 30850C07\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a0 30850C08\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a4 30850C09\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a8 30850C0A\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ac 30850C0B\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b0 30850C0C\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b4 30850C0D\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00b8 30850C0E\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00bc 30850C0F\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c0 30850C10\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c4 30850C11\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00c8 30850C12\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00cc 30850C13\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d0 30850C14\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d4 30850C15\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00d8 30850C16\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00dc 30850C17\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e0 30850C18\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e4 30850C19\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00e8 30850C1A\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00ec 30850C1B\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f0 30850C1C\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f4 30850C1D\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00f8 30850C1E\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00fc 30850C1F\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0100 30851C00\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0104 30851C01\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0108 30851C02\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 010c 30851C03\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0110 30851C04\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0114 30851C05\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0118 30851C06\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 011c 30851C07\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0120 30851C08\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0124 30851C09\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0128 30851C0A\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 012c 30851C0B\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0130 30851C0C\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0134 30851C0D\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0138 30851C0E\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 013c 30851C0F\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0140 30851C10\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0144 30851C11\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0148 30851C12\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 014c 30851C13\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0150 30851C14\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0154 30851C15\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0158 30851C16\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 015c 30851C17\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0160 30851C18\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0164 30851C19\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0168 30851C1A\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 016c 30851C1B\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0170 30851C1C\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0174 30851C1D\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0178 30851C1E\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 017c 30851C1F\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==96] then { pass $testname } else { fail $testname }
}

proc do_media {} {
    set testname "media.s: media tests"
    set x 0

    gas_start "media.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 096703CC\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 0967034C\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 0967030C\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 096702CC\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 F8078B4B\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 0967074C\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 0967078C\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 096707CC\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 F8E0CF4B\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 F8E0CF4B\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 F8E0CB4B\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 0967054C\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 0967058C\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 096705CC\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 0ACE01C9\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 0ACE0149\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 0ACE0109\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 FACE8409\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 FACEC409\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c FACE8009\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 FACEC009\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 FAD60E49\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 FAD64A89\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c FAD66309\[^\n\]*\n"	{set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==24] then { pass $testname } else { fail $testname }
}

proc do_special {} {
    set testname "special.s: special tests"
    set x 0

    gas_start "special.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 04A41680\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 04A416A0\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 04A41A80\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 04A41AA0\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==4] then { pass $testname } else { fail $testname }
}

proc do_perf {} {
    set testname "perf.s: perf tests"
    set x 0

    gas_start "perf.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).

    # The third one is questionable.  HP as doesn't generate what the book
    # says.  It outputs the nullify flag at 30 instead.

    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 30000680\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 30000280\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 300002A0\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==3] then { pass $testname } else { fail $testname }
}

proc do_spop {} {
    set testname "spop.s: spop tests"
    set x 0

    # This tickles a bug in the expression parser.
    gas_start "spop.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 10000105\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 10001913\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 10000125\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 10001933\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 10002B05\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 10039B05\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 10002B25\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 10039B25\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 10A00505\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 10A01D13\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 10A00525\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 10A01D33\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 10C50705\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 10C51F13\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 10C50725\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 10C51F33\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==16] then { pass $testname } else { fail $testname }
}

proc do_copr {} {
    set testname "copr.s: copr tests"
    set x 0

    gas_start "copr.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 30000105\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 30000713\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 30000125\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 30000733\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==4] then { pass $testname } else { fail $testname }
}

proc do_coprmem {} {
    set testname "coprmem.s: copr memory tests"
    set x 0

    gas_start "coprmem.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # Instead of having a variable for each match string just increment the
    # total number of matches seen.  That's simpler when testing large numbers
    # of instructions (as these tests to).
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 2485011A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 2485211A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 2485013A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 2485213A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 2C85011A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 2C85211A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 2C85013A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 2C85213A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 2485031A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 2485231A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 2485033A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 2485233A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 2C85031A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 2C85231A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 2C85033A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 2C85233A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 2480111A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 2480313A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 2480113A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 2C80111A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 2C80313A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 2C80113A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 2480131A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 2480333A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 2480133A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 2C80131A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 2C80333A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 2C80133A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==28] then { pass $testname } else { fail $testname }
}

proc do_fmem_LR_tests {} {
    set testname "fmemLRbug.s: LR register selection on fp mem instructions"
    set x 0

    gas_start "fmemLRbug.s" "-al"

    # Make sure we correctly handle field selectors. 
    while 1 {
	expect {
	    -re "^ +\[0-9\]+ 0000 27401246\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 27481206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 27501206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c 2F481206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 2F501206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 27401046\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 27481006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c 27501006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 2F481006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 2F501006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 27401246\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c 27481206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 27501206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 2F481206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 2F501206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 27401046\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0040 27481006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0044 27501006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0048 2F481006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 004c 2F501006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0050 27590246\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0054 27590206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0058 27590206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 005c 2F590206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0060 2F590206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0064 27590046\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0068 27590006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 006c 27590006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0070 2F590006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0074 2F590006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0078 27590246\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 007c 27590206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0080 27590206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0084 2F590206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0088 2F590206\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 008c 27590046\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0090 27590006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0094 27590006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0098 2F590006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 009c 2F590006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a0 E840C000\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 00a4 08000240\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "\[^\n\]*\n"				{ }
	    timeout				{ perror "timeout\n"; break }
	    eof					{ break }
	}
    }

    # This was intended to do any cleanup necessary.  It kinda looks like it
    # isn't needed, but just in case, please keep it in for now.
    gas_finish

    # Did we find what we were looking for?  If not, flunk it.
    if [expr $x==42] then { pass $testname } else { fail $testname }
}

if [istarget hppa*-*-*] then {
    # Test the basic instruction parser.
    do_imem
    do_immed
    do_branch
    do_add
    do_add2
    do_sh1add
    do_sh2add
    do_sh3add
    do_shladd
    do_shladd2
    do_sub
    do_sub2
    do_ds
    do_comclr
    do_logical
    do_unit
    do_unit2
    do_dcor
    do_dcor2
    do_addi
    do_subi
    do_shift
    do_shift2
    do_shift3
    do_extract
    do_extract2
    do_extract3
    do_deposit
    do_deposit2
    do_deposit3
    do_system
    do_system2
    do_purge
    do_purge2
    do_fp_misc
    do_fmem
    do_fp_comp
    do_fp_conv
    do_fp_fcmp
    do_special
    do_perf
    do_spop
    do_copr
    do_coprmem

    # The "weird.s" file from the gdb testsuite.  Simply verify it
    # assembles.
    gas_test "weird.s" "" "" "stabs parsing"

    # Test that we correctly assemble some FP memory tests which
    # L/R register selects.  (Regression test for a bug Tege found).
    do_fmem_LR_tests

    # PA2.0 tests
    do_fp_comp2
    do_branch2
    do_media
}
